package com.ruoyi.traplight.domain.aliyun;

import com.alibaba.fastjson2.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.aspectj.lang.annotation.DeclareAnnotation;

import java.awt.datatransfer.Clipboard;
import java.util.Date;
import java.util.List;

@Data
@Accessors(chain = true)
public class DeviceProperties {
    /**
     * 设备id
     */
    @JSONField(serialize = false)
    private Integer deviceId;
    /**
     * aliyun-deviceName,唯一标识符
     */
    @JSONField(serialize = false)
    private String deviceName;

    @JSONField(name = "WorkMode")
    private Integer workMode;

    @JSONField(serialize = false)
    private String workModeTime;

    @JSONField(name = "RainStatus",serialize = false)
    private Integer rainStatus;

    @JSONField(serialize = false)
    private String rainStatusTime;

    @JSONField(name = "RainWorkMode")
    private Integer rainWorkMode;

    @JSONField(serialize = false)
    private String rainWorkModeTime;

    @JSONField(name = "PhotoParams")
    private PhotoParams photoParams;

    @JSONField(serialize = false)
    private String photoParamsTime;

    @JSONField(name = "GeoLocation",serialize = false)
    private GeoLocation geoLocation;

    @JSONField(serialize = false)
    private String geoLocationTime;

    @JSONField(name = "ProduceInfo",serialize = false)
    private ProduceInfo produceInfo;

    @JSONField(serialize = false)
    private String produceInfoTime;

    @JSONField(name = "BatteryPercentage",serialize = false)
    private Double batteryPercentage;

    @JSONField(serialize = false)
    private String batteryPercentageTime;

    @JSONField(name = "LightStatus",serialize = false)
    private Integer lightStatus;

    @JSONField(serialize = false)
    private String lightStatusTime;

    @JSONField(name = "TimeModeSet")
    private List<TimeModeSet> timeModeSet;

    @JSONField(serialize = false)
    private String timeModeSetTime;

    @JSONField(name = "DormantModeSet")
    private DormantModeSet dormantModeSet;

    @JSONField(serialize = false)
    private String dormantModeSetTime;

    @JSONField(name = "SeasonSet")
    private List<SeasonSet> seasonSet;

    @JSONField(serialize = false)
    private String seasonSetTime;

    @JSONField(name = "EngineeringMode")
    private EngineeringMode engineeringMode;

    @JSONField(serialize = false)
    private String engineeringModeTime;

    @JSONField(name = "Temperature",serialize = false)
    private Float temperature;

    @JSONField(serialize = false)
    private String temperatureTime;

    @JSONField(name = "WarnSetting")
    private WarnSetting warnSetting;

    @JSONField(serialize = false)
    private String warnSettingTime;

//    private String manualId;

    @Data
    public static class PhotoParams{
        @JSONField(name = "PhotoTime",ordinal = 1)
        private int photoTime;
        @JSONField(name = "PhotoNo", ordinal = 2)
        private int photoNo;
    }

    @Data
    public static class GeoLocation{
        @JSONField(name = "Latitude",ordinal = 2)
        private double latitude;
        @JSONField(name = "Longitude",ordinal = 1)
        private double longitude;
    }

    @Data
    public static class ProduceInfo{
        @JSONField(name = "AppVersion",ordinal = 1)
        private String appVersion;
        @JSONField(name = "DeviceModel",ordinal = 2)
        private String deviceModel;
        @JSONField(name = "SerialNo",ordinal = 3)
        private String serialNo;
        @JSONField(name = "IOTCardNo",ordinal = 4)
        private String iotCardNo;
        @JSONField(name = "DeviceID", ordinal = 5)
        private String deviceId;
        @JSONField(name = "DeviceName",ordinal = 6)
        private String deviceName;
    }

    @Data
    public static class TimeModeSet{
        @JSONField(name = "SlotStartTime",ordinal = 1)
        private int slotStartTime;
        @JSONField(name = "SlotPhotoTime",ordinal = 2)
        private int slotPhotoTime;
        @JSONField(name = "SlotEndTime",ordinal = 3)
        private int slotEndTime;
        @JSONField(name = "SlotPhotoPages",ordinal = 4)
        private int slotPhotoPages;
        @JSONField(name = "SlotEnable",ordinal = 5)
        private int slotEnable;
    }

    @Data
    public static class DormantModeSet{
        @JSONField(name = "DormantTime",ordinal = 1)
        private int dormantTime;
        @JSONField(name = "DormantStartTime",ordinal = 2)
        private long dormantStartTime;
    }

    @Data
    public static class SeasonSet{
        @JSONField(name = "SeasonEnable",ordinal = 1)
        private int seasonEnable;
        @JSONField(name = "SeasonStartTime",ordinal = 2)
        private String seasonStartTime;
        @JSONField(name = "SeasonEndTime",ordinal = 3)
        private String seasonEndTime;
    }
    @Data
    public static class WarnSetting{
        @JSONField(name = "BatteryWarn",ordinal = 1)
        private double batteryWarn;
        @JSONField(name = "LongitudeWarn",ordinal = 2)
        private double longitudeWarn;
        @JSONField(name = "LatitudeWarn",ordinal = 3)
        private double latitudeWarn;
    }

    @Data
    public static class EngineeringMode{
        @JSONField(name = "HeaterTopTemp",ordinal = 1)
        private float heaterTopTemp;
        @JSONField(name = "RainExitThreshold",ordinal = 2)
        private float rainExitThreshold;
        @JSONField(name = "RainEntryThreshold",ordinal = 3)
        private float rainEntryThreshold;
        @JSONField(name = "LowTempCompensation",ordinal = 4)
        private double lowTempCompensation;
        @JSONField(name = "LightEntryThreshold",ordinal = 5)
        private float lightEntryThreshold;
        @JSONField(name = "TrackMoveLength",ordinal = 6)
        private int trackMoveLength;
        @JSONField(name = "RestartTime",ordinal = 7)
        private int restartTime;
        @JSONField(name = "TempCalibration",ordinal = 8)
        private double tempCalibration;
        @JSONField(name = "TrackSpeed",ordinal = 9)
        private int trackSpeed;
        @JSONField(name = "TopTempCompensation",ordinal = 10)
        private double topTempCompensation;
        @JSONField(name = "HeaterLowTemp",ordinal = 11)
        private float heaterLowTemp;
        @JSONField(name = "LocationOffsetDistance",ordinal = 12)
        private int locationOffsetDistance;
        @JSONField(name = "LightExitThreshold",ordinal = 13)
        private float lightExitThreshold;
        @JSONField(name = "LowTempEntryThreshold",ordinal = 14)
        private int lowTempEntryThreshold;
        @JSONField(name = "RainDuration",ordinal = 15)
        private int rainDuration;
        @JSONField(name = "PhotoQuality",ordinal = 16)
        private int photoQuality;
    }
}
